package com.jmp.base;

import com.jmp.base.dto.*;
import one.stand.model.ResultModel;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 模板能力API
 */
public interface TemplateApi {
    /**
     * 默认企业id：0 总后台
     */
    Integer DEFAULT_COMPANYID = 0;
    /**
     * 草稿
     */
    int STATE_DRAFT = 0;
    /**
     * 发布
     */
    int STATE_DEPLOY = 1;

    /**
     * 模板类型-默认
     */
    int CARD_TYPE_DEFAULT = 0;
    /**
     * 模板类型-自定义
     */
    int CARD_TYPE_DIY = 1;


    /**** config  ****/
    @PostMapping("/template/save")
    ResultModel save(@RequestBody TemplateSaveRequest request);

    @PostMapping("/template/detail")
    ResultModel<TemplateDetailResponse> detail(@RequestBody TemplateDetailRequest request);

    @PostMapping("/template/up")
    ResultModel up(@RequestBody TemplateUpRequest request);

    @PostMapping("/template/down")
    ResultModel down(@RequestBody TemplateDownRequest request);

    @PostMapping("/template/preview")
    ResultModel<TemplatePreviewResponse> preview(@RequestBody TemplatePreviewRequest request);

    /**** data  *****/
    @PostMapping("/template/create")
    ResultModel<TemplateCreateResponse> create(@RequestBody TemplateCreateRequest request);

    @PostMapping("/template/get")
    ResultModel<TemplateGetResponse> get(@RequestBody TemplateGetRequest request);

    @PostMapping("/template/get2")
    ResultModel<TemplateGetResponse> get2(@RequestBody TemplateGet2Request request);

    @PostMapping("/template/update/card")
    ResultModel updateByCard(@RequestBody TemplateUpdateByCardRequest request);

    @PostMapping("/template/remove/article")
    ResultModel removeArticle(@RequestBody TemplateRemoveArticleRequest request);

    @PostMapping("/template/list")
    ResultModel<TemplateListVo> list(@RequestBody TemplateListDto request);

    /**
     * 异步、预生成海报
     */
    @PostMapping("/template/list/async")
    ResultModel listAsync(@RequestBody TemplateListDto request);

    enum Type {
        /**
         * 小程序-名片分享
         */
        ID_WECHAT_CARD,
        /**
         * CrmApp-名片分享
         */
        ID_CRM_APP_CARD,
        /**
         * CrmApp-商品分享
         */
        ID_CRM_APP_GOODS,
        /**
         * CrmApp-文章分享
         */
        ID_CRM_APP_ARTICLE_0,
        /**
         * 文章分享H5-名片海报
         */
        ID_ARTICLE_H5_CARD,
        /**
         * 文章分享H5-微信二维码海报
         */
        ID_ARTICLE_H5_WXCODE,
        /**
         * 直播间-微信二维码海报
         */
        ID_ROOM,
        /**
         * CrmApp-拼图分享
         */
        ID_GROUP,
    }
}
